<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<h:title>Display Offers</h:title>
</h:head>
<h:body>
	<h:form>
	 <p:menubar>
          	<p:menuitem value="Index" icon="ui-icon-refresh" url="index.xhtml" />
            
            <p:menuitem value="My Bookings!" icon="ui-icon-contact" url="userBookings.xhtml"/>  
            
            <p:menuitem value="Last Offers!" icon="ui-icon-search" url="packages.xhtml" />            
       
        <f:facet name="options">  
            <p:commandButton type="submit" ajax="false" action = "#{logoutBean.logout()}" value="Logout" icon="ui-icon-extlink" />  
        </f:facet>
       
       </p:menubar>
        </h:form>
<p:panel>
	
        <h:panelGrid>
        <h:link outcome="bookings" value="Personalize it and Book it!" /> 
       
        </h:panelGrid>
  
    
</p:panel>
<h:form id="form">  
  
    <p:dataTable id="packagesTable" var="package" value="#{packageBean.packUser}" 
 
                 paginator="true"
                 filteredValue="#{packageBean.filteredUser}" 
				 scrollable="true"
                 emptyMessage="There are NO Packages"
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				 rowsPerPageTemplate="5,10,15"
                 scrollHeight="200"
                 cellSeparator="true"
				 resizableColumns="true">  
  
        
        <p:column headerText="Residence Type" sortBy="resType" filterBy="resType" id="resType">  
            #{package.residence.type}
        </p:column>  
        
        <p:column headerText="City" sortBy="city" filterBy="city" id="city">  
            #{package.residence.city}
        </p:column>  
        
        <p:column headerText="Beds" sortBy="beds" filterBy="beds" id="beds">  
            #{package.residence.beds}
        </p:column>  
        
        <p:column headerText="Departure Transport" sortBy="depType" filterBy="depType" id="depType">  
            #{package.departureTransport.type}
        </p:column>  
        
        <p:column headerText="From" sortBy="fromPlace" filterBy="fromPlace" id="fromPlace">  
            #{package.departureTransport.fromPlace}
        </p:column>  
        
        <p:column headerText="Number Of Passengers" sortBy="passengers" filterBy="passengers" id="passengers">  
            #{package.departureTransport.passengers}
        </p:column>  
        
        <p:column headerText="Return Transport" sortBy="retType" filterBy="retType" id="retType">  
            #{package.returnTransport.type}
        </p:column>  
        
        
        <p:column headerText="From" sortBy="from" filterBy="from" id="from">  
            #{package.residence.fromDate}
        </p:column>  
        
        <p:column headerText="To" sortBy="to" filterBy="to" id="to">  
            #{package.residence.toDate}
        </p:column>   
        
        <p:column headerText="Excursion Type" sortBy="excursion" filterBy="excursion" id="excursion">  
            #{package.excursion.type}
        </p:column>  
        
        <p:column headerText="Price" sortBy="price" filterBy="price" id="price" >  
            #{package.price}
        </p:column> 
  

  
  
          
		<p:column style="width:32px">
        	
            <p:commandButton id="viewButton"  type="submit" ajax="false" icon="ui-icon-disk"  
                    action="#{packageBean.selectPackageForPersonalization()}">
            <f:setPropertyActionListener value="#{package}"  
                     target="#{packageBean.packageSelected}" />                  
            </p:commandButton>
		</p:column>	
		
		
		        <p:column style="width:32px">  
             <p:commandButton id="det"   oncomplete="dialog.show()"
             		update=":form1:genGrid, :form2:resGrid, :form3:depTransGrid, :form4:retTransGrid,
             		:form5:excGrid"   
                     icon="ui-icon ui-icon-search" style="width:32px">  
              
                 <f:setPropertyActionListener value="#{package}" 
                     target="#{packageBean.packageSelected}" />  
        </p:commandButton> 
        </p:column>
		

        
   
  
   </p:dataTable> 
   </h:form> 
  
 	
	<p:dialog id="dialog" header="Details" widgetVar="dialog" resizable="true"  
              width="600" height="400"  showEffect="exlpode" hideEffect="explode" closeOnEscape="true">
	<h:form id="form1">
		<p:panel header="General Details">
	        <h:panelGrid  id="genGrid" columns="2" >
	        
					<h:outputLabel>Available*:</h:outputLabel>
					<p:selectBooleanCheckbox value="#{packageBean.packageSelected.available}" disabled="true" />
				
					<h:outputLabel>Disponibility*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.disponibility}" />
		            
		
					<h:outputLabel>Price*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.price}" />
			
	

					<h:outputLabel>Discount(%)*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.discount}" />
					
			
		
		</h:panelGrid>
		</p:panel>
</h:form>


			<h:form id="form2">
			<p:panel header="Residence Details">
	        <h:panelGrid  id="resGrid" columns="2" >   
	   
				<h:outputLabel>Available*:</h:outputLabel>
				<p:selectBooleanCheckbox value="#{packageBean.packageSelected.residence.available}" disabled="true" />
			
				<h:outputLabel>Disponibility*:</h:outputLabel>
				<h:outputText value="#{packageBean.packageSelected.residence.disponibility}" />
	            
	
				<h:outputLabel>Price*:</h:outputLabel>
				<h:outputText value="#{packageBean.packageSelected.residence.price}" />
			
				
			
				<h:outputLabel>Residence Type*:</h:outputLabel>
				<h:outputText value="#{packageBean.packageSelected.residence.type}" />  
				
				
				
				<h:outputLabel>Name*:</h:outputLabel>
				<h:outputText value="#{packageBean.packageSelected.residence.residenceName}" /> 
				
				<h:outputLabel>City*:</h:outputLabel>
				<h:outputText value="#{packageBean.packageSelected.residence.city}" /> 
				
				<h:outputLabel>Country*:</h:outputLabel>
				<h:outputText value="#{packageBean.packageSelected.residence.country}" />
				
	
				<h:outputLabel>Address*:</h:outputLabel>
				<h:outputText value="#{packageBean.packageSelected.residence.address}" />
		
				<h:outputLabel>From*:</h:outputLabel>
				<p:calendar value="#{packageBean.packageSelected.residence.fromDate}" disabled="true" />
				
		
				<h:outputLabel>To*:</h:outputLabel>
				<p:calendar value="#{packageBean.packageSelected.residence.toDate}" disabled="true"/>
				
		
		
				<h:outputLabel >Site:</h:outputLabel>
				<h:outputText value="#{packageBean.packageSelected.residence.site}"/> 
		
	
				<h:outputLabel>Phone:</h:outputLabel>
				<h:outputText value="#{packageBean.packageSelected.residence.phoneNumber}"/>
		
	
				<h:outputLabel>Rooms*:</h:outputLabel>
				<h:outputText value="#{packageBean.packageSelected.residence.rooms}"/> 
		
				<h:outputLabel>Beds*:</h:outputLabel>
				<h:outputText value="#{packageBean.packageSelected.residence.rooms}"/>
			
				<h:outputLabel>Stars:</h:outputLabel>
				<p:rating value="#{packageBean.packageSelected.residence.stars}" disabled="true"/>  
	  
	   
	        </h:panelGrid> 
	        </p:panel>
	        </h:form>

	        <h:form id="form3">
	        <p:panel header=" Departure Transport Details">
	        <h:panelGrid  id="depTransGrid" columns="2" >   
	   
								
					<h:outputLabel>Available*:</h:outputLabel>
					<p:selectBooleanCheckbox 
					value="#{packageBean.packageSelected.departureTransport.available}" disabled="true"/>
					
	
					<h:outputLabel>Disponibility*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.departureTransport.disponibility}" />
	
					<h:outputLabel>Price*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.departureTransport.price}"/>
					

					<h:outputLabel>Transport Type*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.departureTransport.type}" />
				
		
					<h:outputLabel>Number of Passengers*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.departureTransport.passengers}" />

					<h:outputLabel>Class*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.departureTransport.classNumber}" />
	
					<h:outputLabel>From (Place)*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.departureTransport.fromPlace}" />
	
					<h:outputLabel>To (Place)*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.departureTransport.toPlace}" />
	
					<h:outputLabel>Departure Date*:</h:outputLabel>
					<p:calendar value="#{packageBean.packageSelected.departureTransport.departureDate}" disabled="true"  />
				
	
					<h:outputLabel>Departure Time*:</h:outputLabel>
					<p:calendar value="#{packageBean.packageSelected.departureTransport.departureTime}"  pattern="HH:mm" timeOnly="true" disabled="true"/>					
					
					<h:outputLabel>Departure Company:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.departureTransport.company}" />
					
					<h:outputLabel>Flight ID:</h:outputLabel>
					<h:outputText  value="#{packageBean.packageSelected.departureTransport.flightId}" />
				
	        </h:panelGrid> 
	        </p:panel>
	     </h:form>
	     

			<h:form id="form4">
			<p:panel header="Return Transport Details" >
	        <h:panelGrid header="Return Transport Details" id="retTransGrid" columns="2" >   
	   
								
					<h:outputLabel>Available*:</h:outputLabel>
					<p:selectBooleanCheckbox  
					value="#{packageBean.packageSelected.returnTransport.available}" disabled="true"/>
					
	
					<h:outputLabel>Disponibility*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.returnTransport.disponibility}" />
	
					<h:outputLabel>Price*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.returnTransport.price}" />
					

					<h:outputLabel>Transport Type*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.returnTransport.type}" />
				
		
					<h:outputLabel>Number of Passengers*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.returnTransport.passengers}" />

					<h:outputLabel>Class*:</h:outputLabel>
					<h:outputText id="classNumber" value="#{packageBean.packageSelected.returnTransport.classNumber}"/>
	
					<h:outputLabel>From (Place)*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.returnTransport.fromPlace}" />
	
					<h:outputLabel>To (Place)*:</h:outputLabel>
					<h:outputText  value="#{packageBean.packageSelected.returnTransport.toPlace}" />
	
					<h:outputLabel>Departure Date*:</h:outputLabel>
					<p:calendar value="#{packageBean.packageSelected.returnTransport.departureDate}" disabled="true"  id="departureDate"/>
				
	
					<h:outputLabel>Departure Time*:</h:outputLabel>
					<p:calendar value="#{packageBean.packageSelected.returnTransport.departureTime}"  pattern="HH:mm" timeOnly="true" disabled="true"/>					
					
					<h:outputLabel>Departure Company:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.returnTransport.company}" />
					
					<h:outputLabel>Flight ID:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.returnTransport.flightId}" />
				
	        </h:panelGrid> 
	        </p:panel>
	        </h:form>

	     

			<h:form id="form5">
			<p:panel header=" Excursion Details">
	        <h:panelGrid id="excGrid" columns="2"  > 
	          
					<h:outputLabel>Available*:</h:outputLabel>
					<p:selectBooleanCheckbox value="#{packageBean.packageSelected.excursion.available}" disabled="true" />
					
				
					<h:outputLabel>Disponibility*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.excursion.disponibility}"/>
			
					<h:outputLabel>Price*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.excursion.price}"/>
			
					<h:outputLabel>Type*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.excursion.type}" />
			
					<h:outputLabel>Description*:</h:outputLabel>
					<h:outputText value="#{packageBean.packageSelected.excursion.description}" rows="6" cols="33" />
			
					<h:outputLabel >Date*:</h:outputLabel>
					<p:calendar value="#{packageBean.packageSelected.excursion.date}"  disabled="true"/>
		
					<h:outputLabel>Start Time*:</h:outputLabel>
					<p:calendar value="#{packageBean.packageSelected.excursion.startTime}"  pattern="HH:mm" timeOnly="true" disabled="true"/>
		
					<h:outputLabel>End Time*:</h:outputLabel>
					<p:calendar value="#{packageBean.packageSelected.excursion.endTime}"  pattern="HH:mm" timeOnly="true" disabled="true"/>
								
					
	        </h:panelGrid> 
	        </p:panel>
	        </h:form>
	     </p:dialog>
	  
  
 
</h:body>

</html>